package com.llh.cheap;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.moirae.rest.AbstractRestResponse;
import top.moirae.rest.SuccessRestResponse;
import top.moirae.security.SecurityInitializer;


@RestController
@RequestMapping("/environment")
public class EnvironmentController {

    private final SecurityInitializer securityInitializer;

    @Autowired
    public EnvironmentController(SecurityInitializer securityInitializer) {
        this.securityInitializer = securityInitializer;
    }

    @GetMapping
    public AbstractRestResponse get(HttpServletRequest request) {
        securityInitializer.init();
        return SuccessRestResponse.apply("PONG");
    }

}
